package com.zhonghui.modlules.product.eshopDomain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.eshop.domain.BaseDomain;

import javax.validation.constraints.NotBlank;

@TableName("store_category")
public class StoreCategory extends BaseDomain {
    @TableId
    private Integer id;
    private Integer pid;
    @NotBlank(
            message = "分类名称必填"
    )
    private String cateName;
    private Integer sort;
    private String pic;
    private Integer isShow;

    public void copy(StoreCategory source) {
        BeanUtil.copyProperties(source, this, CopyOptions.create().setIgnoreNullValue(true));
    }

    public StoreCategory() {
    }

    public Integer getId() {
        return this.id;
    }

    public Integer getPid() {
        return this.pid;
    }

    public String getCateName() {
        return this.cateName;
    }

    public Integer getSort() {
        return this.sort;
    }

    public String getPic() {
        return this.pic;
    }

    public Integer getIsShow() {
        return this.isShow;
    }

    public void setId(final Integer id) {
        this.id = id;
    }

    public void setPid(final Integer pid) {
        this.pid = pid;
    }

    public void setCateName(final String cateName) {
        this.cateName = cateName;
    }

    public void setSort(final Integer sort) {
        this.sort = sort;
    }

    public void setPic(final String pic) {
        this.pic = pic;
    }

    public void setIsShow(final Integer isShow) {
        this.isShow = isShow;
    }

    public String toString() {
        return "StoreCategory(id=" + this.getId() + ", pid=" + this.getPid() + ", cateName=" + this.getCateName() + ", sort=" + this.getSort() + ", pic=" + this.getPic() + ", isShow=" + this.getIsShow() + ")";
    }

    public boolean equals(final Object o) {
        if (o == this) {
            return true;
        } else if (!(o instanceof StoreCategory)) {
            return false;
        } else {
            StoreCategory other = (StoreCategory)o;
            if (!other.canEqual(this)) {
                return false;
            } else if (!super.equals(o)) {
                return false;
            } else {
                Object this$id = this.getId();
                Object other$id = other.getId();
                if (this$id == null) {
                    if (other$id != null) {
                        return false;
                    }
                } else if (!this$id.equals(other$id)) {
                    return false;
                }

                Object this$pid = this.getPid();
                Object other$pid = other.getPid();
                if (this$pid == null) {
                    if (other$pid != null) {
                        return false;
                    }
                } else if (!this$pid.equals(other$pid)) {
                    return false;
                }

                label71: {
                    Object this$sort = this.getSort();
                    Object other$sort = other.getSort();
                    if (this$sort == null) {
                        if (other$sort == null) {
                            break label71;
                        }
                    } else if (this$sort.equals(other$sort)) {
                        break label71;
                    }

                    return false;
                }

                label64: {
                    Object this$isShow = this.getIsShow();
                    Object other$isShow = other.getIsShow();
                    if (this$isShow == null) {
                        if (other$isShow == null) {
                            break label64;
                        }
                    } else if (this$isShow.equals(other$isShow)) {
                        break label64;
                    }

                    return false;
                }

                Object this$cateName = this.getCateName();
                Object other$cateName = other.getCateName();
                if (this$cateName == null) {
                    if (other$cateName != null) {
                        return false;
                    }
                } else if (!this$cateName.equals(other$cateName)) {
                    return false;
                }

                Object this$pic = this.getPic();
                Object other$pic = other.getPic();
                if (this$pic == null) {
                    if (other$pic != null) {
                        return false;
                    }
                } else if (!this$pic.equals(other$pic)) {
                    return false;
                }

                return true;
            }
        }
    }

    protected boolean canEqual(final Object other) {
        return other instanceof StoreCategory;
    }

    public int hashCode() {
        boolean PRIME = true;
        int result = super.hashCode();
        Object $id = this.getId();
        result = result * 59 + ($id == null ? 43 : $id.hashCode());
        Object $pid = this.getPid();
        result = result * 59 + ($pid == null ? 43 : $pid.hashCode());
        Object $sort = this.getSort();
        result = result * 59 + ($sort == null ? 43 : $sort.hashCode());
        Object $isShow = this.getIsShow();
        result = result * 59 + ($isShow == null ? 43 : $isShow.hashCode());
        Object $cateName = this.getCateName();
        result = result * 59 + ($cateName == null ? 43 : $cateName.hashCode());
        Object $pic = this.getPic();
        result = result * 59 + ($pic == null ? 43 : $pic.hashCode());
        return result;
    }
}


